package com.special.threademo.jvm.classLoader;

/**
 * Created with IDEA2020.3
 * author:LiuYC
 * DateTime:2021/1/23  17:25
 */
class Cl {
    static {
        System.out.println("initive use");
    }
}

public class PositiveUseDemo {
    public static void main(String[] args) throws Exception {
        // 调用class Loader的loadclass不是对类的主动使用！
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        Class<?> aClass = systemClassLoader.loadClass("com.special.threademo.jvm.classLoader.Cl");
        System.out.println("aClass");
        System.out.println("========================");
        // 这是符合主动使用的情况！！！
        Class<?> aClass1 = Class.forName("com.special.threademo.jvm.classLoader.Cl");
        System.out.println(aClass1);
    }
}
